import { createStore, applyMiddleware } from 'redux'
import reducer from './reducer'
import Immutable from 'immutable'
import createSagaMiddleware from 'redux-saga'
import sagas from './sagas'

const sagaMiddleware = createSagaMiddleware()
const initialState = Immutable.Map()

const store = createStore(
  reducer,
  initialState,
  applyMiddleware(sagaMiddleware)
)
console.log(sagas);
sagas.forEach(saga => sagaMiddleware.run(saga))
// sagaMiddleware.run(sagas)
export default store